#include "LabeledSlider.h"

LabeledSlider::LabeledSlider (QWidget *parent)
        :QWidget(parent)
{
    slider= new QSlider(this);
    nowValue=new QLabel;
    connect(slider, SIGNAL(valueChanged(int)), nowValue, SLOT(setNum(int)));
    labels = new QVBoxLayout;
    labeledSlider = new QHBoxLayout;
    labeledSlider->addWidget(slider);
    labeledSlider->addLayout(labels);
    main=new QVBoxLayout;
    main->addWidget(nowValue);
    main->addLayout(labeledSlider);
    setLayout(main);
}
void LabeledSlider::setLabels(QStringList labelList)
{
    for (i = labelList.size()-1; i>=0; i--)
    {
        label[i] = new QLabel;
        label[i]->setText(labelList.at(i));
        labels->addWidget(label[i]);
    }
}
